package com.example.entity

import com.baomidou.mybatisplus.annotation.*
import java.time.LocalDateTime

@TableName("t_user")
data class User(

    // 雪花算法默认主键变量名id，如果是其他名字则增加@TableId
    @TableId("uid")
    val id: Long? = null,

    @TableField("name")
    val username: String? = null,

    val age: Int? = null,
    val email: String? = null,

    // 字段自动填充功能
    @TableField(fill = FieldFill.INSERT)
    val createTime: LocalDateTime? = null,

    @TableField(fill = FieldFill.INSERT_UPDATE)
    val updateTime: LocalDateTime? = null,

    // 逻辑删除
    @TableLogic
    @TableField("is_deleted")
    val deleted: Boolean = false
)